package luongvd.appview.model.Delegate;

import java.util.ArrayList;
import java.util.List;

import luongvd.appview.common.utils.ServerConnectionUtils;

import org.apache.http.NameValuePair;
import org.apache.http.message.BasicNameValuePair;

import android.os.Handler;

public class ServerDelegate {
	public static final String LINK_SERVER = "http://m.s2vnn.com/";
	public static final String LINK_GET_URL = "http://m.s2vnn.com/ajax/mobile/app/getLink/";
	public static final String LINK_SET_DONE = "http://m.s2vnn.com/ajax/mobile/app/setDone/";
	static String strLocation = "VMM51";

	public static Thread connectServer(final Handler handler,final String url) {
		final List<NameValuePair> params = new ArrayList<NameValuePair>();
		params.add(new BasicNameValuePair("locale", strLocation));
		final Runnable runnable = new Runnable() {
			@Override
			public void run() {
				ServerConnectionUtils.getFromURL(url, params, handler, null);
			}
		};
		return ServerConnectionUtils.performOnBackgroundThread(runnable);
	}

}
